<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>首页查询</title>
    <link rel="stylesheet" type="text/css" href="css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="css/set.css"/>
    <link rel="stylesheet" type="text/css" href="css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
    <style>
        body {
            width: 100%;
            height: auto;
            background-color: #fff;
        }

        html, body {
            overflow-x: hidden;
            overflow-y: hidden;
        }

        .aui-bar-nav {
            line-height: 3.85rem;
        }

        .bar-btn-navbg {
            margin-top: 64px;
        }

        .aui-bar-nav .aui-btn {
            height: 64px;
            line-height: 64px;
            width: auto;
        }

        .aui-bar-nav .aui-pull-right {
            padding: 0 15px;
        }

        .big_bgc {
            width: 150%;
            position: relative;
            margin-left: -25%;
            padding: 0 25% 1.2rem;
            border: 0px;
            border-radius: 0 0 50% 50%;
            background: -webkit-linear-gradient(left top, #0F9BEB, #1569C8);
            background: -o-linear-gradient(bottom right, #0F9BEB, #1569C8);
            background: -moz-linear-gradient(bottom right, #0F9BEB, #1569C8);
            background: linear-gradient(to bottom right, #0F9BEB, #1569C8);
            box-shadow: 0 4px 10px rgba(12, 94, 187, 0.5);
            z-index: 1000;
        }

        .nav_swiper {
            width: 100%;
            margin-left: auto;
            margin-right: auto;
            position: relative;
            overflow: hidden;
            z-index: 1;
        }

        div#tab {
            width: 100%;
        }

        .aui-bar-nav,
        .aui-btn {
            color: #FFFFFF;
            background-color: initial;
        }

        .aui-bar-nav .aui-btn .aui-iconfont {
            background-image: url("image/nav_search@2x.png");
            background-position: center;
            background-repeat: no-repeat;
            background-size: 1.1rem;
            font-size: 1rem;
            height: 1.1rem;
            width: 1.1rem;
            padding: 0;
            margin: 0;
            color: #ffffff;
            position: absolute;
            /*top: 22px;*/
            right: 0.75rem;
        }

        .nav_swiper .aui-tab-item {
            color: #8dc2fd;
        }

        .aui-tab-item.aui-active {
            font-size: 0.85rem;
            color: #FFFFFF;
            border-bottom: none;
        }

        .zhangfu {
            position: relative;
        }

        .zhang {
            width: 0;
            height: 0;
            border-left: 3px solid transparent;
            border-right: 3px solid transparent;
            border-top: 5px solid #8BC1FC;
            position: absolute;
            right: 2px;
            bottom: 2px;
        }

        .zhang:active {
            border-top: 5px solid #ffffff;
        }

        .die:active {
            border-bottom: 5px solid #ffffff;
        }

        .die {
            width: 0;
            height: 0;
            border-left: 3px solid transparent;
            border-right: 3px solid transparent;
            border-bottom: 5px solid #8BC1FC;
            position: absolute;
            right: 2px;
            top: 2px;
        }

        .down_relese img {
            max-width: 20px;
            /*padding-bottom: 12px;*/
            display: block;
            position: relative;
            bottom: 0px;
            transform: translate(50% 50%);
            margin: 0 auto;
        }

        .aui-tab-item {
            color: #999999;
        }

        .content_swiper,
        .zixuan_swiper,
        .shizhi_swiper,
        .zhangfu_swiper,
        .btc_swiper,
        .biAn_swiper {
            width: 95%;
            height: auto;
        }

        .content_swiper .swiper-slide .slide-title {
            width: 100%;
            border-bottom: 1px solid #E6E6E6;
        }

        .content_swiper .swiper-slide li,
        .zixuan_swiper .swiper-slide li,
        .shizhi_swiper .swiper-slide li,
        .zhangfu_swiper .swiper-slide li,
        .btc_swiper .swiper-slide li,
        .biAn_swiper .swiper-slide li {
            width: 100%;
            height: 66px;
            line-height: 66px;
            border-bottom: 1px solid #E6E6E6;
            position: relative;
        }

        .bz-nameul .bz-nameli span {
            display: block;
            height: 30px;
            line-height: 23px;
        }

        .bz-nameul .bz-nameli .bz-name-img {
            width: 22%;
            position: relative;
            margin: 0 auto;
            padding-top: 15px;
        }

        .active-icon {
            background-image: url(image/btn/tab_hq_1@2x.png);
            background-size: 20px 20px;
            background-repeat: no-repeat;
            background-position: center;
        }

        .active-font {
            color: #1569C8;
        }

        .swiper-container.nav_swiper.tab-head.swiper-container-horizontal.swiper-container-free-mode {
            margin-bottom: 1rem;
            /*padding-bottom: 0.5rem;*/
        }

        li#tabbar3 {
            position: relative;
        }

        /*新增下拉列表样式*/

        .down_relese {
            height: auto;
            text-align: -webkit-center;
        }

        a.btn-down {
            width: 1rem;
            height: 1rem;
            display: inline-block;
            margin: 0 auto;
        }

        /*section css*/
        /*.aui-bar-nav {
            height: 3.2rem;
            line-height: 3.2rem;
            background-color: #03a9f4;
            color: #ffffff;
        }*/

        section.aui-content.user-info.aui-margin-b-15 {
            background-color: #FFFFFF !important;
        }

        ul.aui-list-header {
            background-color: #FFFFFF !important;
            position: relative;
            overflow: hidden;
            margin: 30px 20px 30px 20px;
        }

        span.list-title {
            font-size: 18px;
            color: #000000;
            margin-right: 10px;
            padding: 4px 0;
        }

        span.list-comment {
            font-size: 12px;
            color: #999999 !important;
            margin-right: 10px;
        }

        .list-btn1 {
            float: right;
            display: inline-block;
            border-radius: 5px;
            color: #FFFFFF;
            background: -webkit-linear-gradient(left top, #0F9BEB, #1569C8) !important;
            /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(bottom right, #0F9BEB, #1569C8) !important;
            /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(bottom right, #0F9BEB, #1569C8) !important;
            /* Firefox 3.6 - 15 */
            background: linear-gradient(to bottom right, #0F9BEB, #1569C8) !important;
            background: -webkit-linear-gradient(left top, #0F9BEB, #1569C8) !important;
            border: 2px solid;
            padding: 5px 25px;
            margin-left: 10px;
        }

        .list-btn2 {
            float: right;
            display: inline-block;
            border-radius: 5px;
            color: #1569C8;
            background: #FFFFFF !important;
            border: 2px solid #1569C8;
            padding: 5px 25px;
            margin-left: 10px;
        }

        .aui-btn {
            width: 80%;
            border: 1px solid #FFFFFF;
            color: #999999;
            background-color: #f4f5f7;
            height: 1.75rem;
            line-height: 1.75rem;
        }

        .aui-btn-active {
            width: 80%;
            border: 1px solid #000000;
            color: #000000;
            height: 1.75rem;
            line-height: 1.75rem;
            background-color: #f4f5f7 !important;
        }

        .aui-col-xs-3 {
            text-align: center;
            margin-top: 0.75rem;
        }

        /*清除aui.css干扰*/

        .aui-margin-b-15 {
            margin-bottom: 0rem !important;
            background-color: #FFFFFF !important;
        }

        .btn-up {
            position: absolute;
            width: 100%;
            bottom: 21px;
            text-align: -webkit-center;
        }

        .btn-up img {
            display: inline-block !important;
            width: 1.25rem !important;
        }

        /*选择时样式*/
        /*展开界面css*/

        #tab {
            height: 1.55rem;
            line-height: 1.55rem;
            /* padding-bottom: 22px; */
            /* padding: 0.4rem; */
            /*margin-bottom: 1rem;*/
        }

        #tab li {
            height: 1rem;
            width: 2.75rem !important;
        }

        .aui-tab-item {
            width: 100%;
            height: 1rem !important;
            line-height: 1rem !important;
        }

        #pannel {
            height: 20rem;
            display: none;
        }

        .user-info {
            padding: 0;
        }

        p {
            text-align: -webkit-center;
        }

        p.slider {
            position: relative;
            margin-top: -1.25rem;
            margin-bottom: 0.75rem;
            z-index: 1001;
        }

        .header-bg {
            background: -webkit-linear-gradient(left top, #0F9BEB, #1569C8);
            background: -o-linear-gradient(bottom right, #0F9BEB, #1569C8);
            background: -moz-linear-gradient(bottom right, #0F9BEB, #1569C8);
            background: linear-gradient(to bottom right, #0F9BEB, #1569C8);
        }

        .big-bg {
            background: #FFFFFF !important;
            border: none;
            padding: 0px 25px;
            box-shadow: 0 0px 0px #FFFFFF;
        }

        .btn-slide {
            display: inline-block;
            width: 1rem;
            height: 1rem;
            background-image: url(image/btn/nav_btn_zk@2x.png);
            background-size: 1rem;
            background-position: center;
            background-repeat: no-repeat;
        }

        .btn-slide-bg {
            background-image: url(image/btn/nav_btn_sq@2x.png);
            position: relative;
            margin-top: 8rem;
            background-size: 1rem;
        }

        .nav-display {
            display: none;
        }

        div#pannel {
            margin-top: -20px;
        }

        .body-bg {
            background-color: #FFFFFF;
        }

        /*下方菜单栏icon*/

        span.active-icon-hq,
        span.icon-hq,
        span.active-icon-sz,
        span.icon-sz {
            position: relative;
            margin-top: 0;
            padding: 0;
            width: 1rem;
            height: 1rem;
            display: inline-block;
            background-size: 1rem;
            background-repeat: no-repeat;
            background-position: center;
        }

        span.active-icon-hq {
            background-image: url(image/btn/tab_hq_1@2x.png);
        }

        span.icon-hq {
            background-image: url(image/btn/tab_hq_0@2x.png);
        }

        span.active-icon-sz {
            background-image: url(image/tab_wode_1@2x.png);
            height: 1.2rem;
        }

        span.icon-sz {
            background-image: url(image/tab_wode_0@2x.png);
        }

        .aui-bar-tab .aui-bar-tab-label {
            display: block;
            font-size: 0.6rem;
            margin-top: -0.25rem;
            position: relative;
        }

        .search-icon-display {
            visibility: hidden;
        }

        .noContent {
            font-size: 0.7rem;
            height: 3.3rem;
            line-height: 3.3rem;
            color: #999999;
            margin-top: -0.6rem;
            z-index: -1000;
        }

        .toMore {
            display: inline-block;
            position: relative;
            margin-bottom: -0.3rem;
            width: 1.1rem;
            height: 1.1rem;
            padding-top: 0px;
            line-height: 1.1rem;
            background-image: url(image/btn/setting_more@2x.png);
            background-size: 1.1rem;
            background-repeat: no-repeat;
            background-position: center;
            background-size: 1.1rem;
        }

        .content {
            /* height: 470px; */
            background: #F5F5F5;
            margin-top: 0.35rem !important;
            position: absolute;
            top: 6.25rem;
            bottom: 0;
            width: 100%;
        }

        .content2 {
            height: auto;
            background: #F5F5F5;
            margin-top: -0;
            z-index: 10000;
            position: absolute;
            bottom: 0;
            top: 0;
            width: 100%;
        }

        iframe#zixuan,
        iframe#shizhi,
        iframe#zhangfu,
        iframe#btc,
        iframe#eth,
        iframe#bian,
        iframe#bitfinex {
            border: none;
        }

        ul.bz-nameul {
            background-color: #ffffff;
        }

        .type-zhang {
            border-top: 5px solid #ffffff;
        }

        .type-die {
            border-bottom: 5px solid #ffffff;
        }
        header#aui-header {
            height: 3.2rem !important;
            line-height: 3.2rem !important;
            padding-top: 1rem !important;
        }
        span#header-title {
            min-height: 2.2rem !important;
            height: 2.2rem !important;
            line-height: 2.2rem !important;
        }
        div#search-icon {
            height: 2.2rem !important;
            line-height: 2.2rem;
        }
        .swiper-container.nav_swiper.tab-head {
            height: 1.55rem;
            line-height: 1.55rem;
            padding: 0.25rem;
        }
        .big_bgc_save{
            padding-bottom: 0 !important;
        }
        span.icon-sz {
            /*height: 2.2rem !important;*/
        }
    </style>
</head>

<body onshow="backBefore()" class="mbody">
<!--顶部logo及搜索栏-->
<div class="big_bgc" id="bigc">
    <header class="aui-bar aui-bar-nav" id="aui-header">
        <div class="serch_bar">
            <span class="aui-title" id="header-title">KKTOKEN</span>
            <div onclick="gotoSearch1()" class="aui-pull-right aui-btn" style="z-index: 100;" id="search-icon">
                <span class="aui-iconfont"></span>
            </div>
        </div>
    </header>
    <!--顶部滑动菜单栏-->
    <div class="swiper-container nav_swiper tab-head" id="nav-swiper">
        <ul class="swiper-wrapper aui-bar-ta" id="tab">
            <li id="tabbar_1" class="swiper-slide aui-tab-item aui-active" onclick="openframe_1()">自选</li>
            <li id="tabbar_2" class="swiper-slide aui-tab-item" onclick="openframe_2()">市值</li>
            <li id="tabbar_3" class="swiper-slide aui-tab-item zhangfu" onclick="openframe3()">涨幅<span class="zhang"
                                                                                                      id="zhang"></span><span
                    class="die" id="die"></span></li>
            <li id="tabbar_4" class="swiper-slide aui-tab-item" onclick="openframe_4()">BTC</li>
            <li id="tabbar_5" class="swiper-slide aui-tab-item" onclick="openframe_5()">ETH</li>
        </ul>
    </div>
</div>
<div class="down_relese" id="pannel">

    <section class="aui-content user-info aui-margin-b-15">
        <ul class="aui-list-header" style="text-align: -webkit-left;">
            <span class="list-title">频道顺序</span>
            <span class="list-comment">点击编辑可排列先后	</span>
            <div class="list-btn1" id="btn1">编&nbsp;辑</div>
        </ul>

        <ul class="aui-card-list-content-padded" id="items">

            <li class="aui-col-xs-3 aui-col-xs-4" data-id="_1">
                <div class="aui-btn">自选</div>
            </li>
            <li class="aui-col-xs-3 aui-col-xs-4" data-id="_2">
                <div class="aui-btn">市值</div>
            </li>
            <li class="aui-col-xs-3 aui-col-xs-4" data-id="_3">
                <div class="aui-btn">涨幅</div>
            </li>
            <li class="aui-col-xs-3 aui-col-xs-5" data-id="_4">
                <div class="aui-btn active-off">BTC</div>
            </li>
            <li class="aui-col-xs-3 aui-col-xs-5" data-id="_5">
                <div class="aui-btn active-off">ETH</div>
            </li>
        </ul>
    </section>

</div>
<p class="slider">
    <a href="" class="btn-slide" id="btn-active">
        <!--<img src="image/btn/nav_btn_zk@2x.png" />-->
    </a>
</p>
<!--列表信息 Start-->
<div class="content" id="frame-container">
    <!--<div class="swiper-container zixuan_swiper"></div>
<div class="swiper-container shizhi_swiper"></div>
<div class="swiper-container zhangfu_swiper"></div>
<div class="swiper-container btc_swiper"></div>
<div class="swiper-container eth_swiper"></div>
<div class="swiper-container biAn_swiper"></div>-->

    <div class="swiper-slide aui-tab-item">

        <ul class="bz-nameul">

            <a href="html/search/search.html">
                <p class="noContent"><span>暂无自选内容，请自行添加</span><span class="toMore"></span></p>
            </a>

        </ul>
    </div>

</div>
<!--列表信息 end-->

<!-- //底部固定菜单栏 -->
<footer class="aui-nav" id="aui-footer">

    <ul class="aui-bar aui-bar-tab" id="footer">
        <li id="hangqing" class="aui-bar-tab-item actve-font" tapmode>
            <a href="index.html" class="aui-bar-tab-item" tapmode>
                <span class="active-icon-hq"></span>
                <div class="aui-bar-tab-label active active-font">行情</div>
            </a>
        </li>

        <li id="" class="aui-bar-tab-item" tapmode>
            <a href="html/set/set.html" class="aui-bar-tab-item" tapmode>
                <span class="icon-sz"></span>
                <div class="aui-bar-tab-label">我的</div>
            </a>
        </li>
    </ul>

</footer>
</body>
<script type="text/javascript" src="script/swiper.min.js"></script>
<script type="text/javascript" src="script/aui-tab.js"></script>
<script type="text/javascript" src="script/api.js"></script>
<script type="text/javascript" src="script/sortable.js"></script>
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="script/tool.js"></script>
<script type="text/javascript">

  var headers = {}
  var exchangeIdArr = [];

  //展开后，点击"编辑"按钮
  var a = 0
  var seleced = false;
  var selecedArr = localStorage.getItem("selecedArr") ? localStorage.getItem("selecedArr").split('|') : ["_4", "_5", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
  var sortable;
  var btn1 = document.getElementById("btn1");
  apiready = function () {
    api.parseTapmode();
    headers = {
      "appVersion": "1.0.0",
      "os": api.systemType,
      "osVersion": api.systemVersion
    }
  }

  function ajax_fordata() {

    exchangeIdArr = JSON.parse(sessionStorage.getItem('result1'))

    if (exchangeIdArr) {
      for (let i of selecedArr) {
        let is = true;
        for (let e of exchangeIdArr) {
          if (i == e.id || i == "_4" | i == "_5") {
            is = false;
            break;
          }
        }
        if (is) {
          console.log("bbbbbbbbb")
          var arr = ["_4", "_5"];
          for (let e of exchangeIdArr) {
            arr.push(e.id + "");
          }
          selecedArr = arr;
          break;
        }
      }
      moveBlocks();
    } else {
      var si = setInterval(function () {
        if (window.parent.headers != {}) {
          clearInterval(si)
          $('#tishi').text("正在加载中")
          $.ajax({
            url: orginlink + '/exchange/getAllExchange',
            type: 'GET',
            headers: headers,
            contentType: "application/json",
            dataType: 'json',
            success: function (result) {
              if (result.code == 0) {
                exchangeIdArr = result.result;
                sessionStorage.setItem('result1', JSON.stringify(exchangeIdArr))

                for (let i of selecedArr) {
                  let is = true;
                  for (let e of exchangeIdArr) {
                    if (i == e.id || i == "_4" | i == "_5") {
                      is = false;
                      break;
                    }
                  }
                  if (is) {
                    console.log("bbbbbbbbb")
                    var arr = ["_4", "_5"];
                    for (let e of exchangeIdArr) {
                      arr.push(e.id + "");
                    }
                    selecedArr = arr;
                    break;
                  }
                }
                moveBlocks();
              }
            }
          });
        }
      }, 100)
    }
  }



  var isbutton = false;
  var type = 3;


  //	点击展开
  $(document).ready(function () {
    $(".btn-slide").click(function () {
      $("#pannel").slideToggle("fast");
        $("#tab").toggleClass("nav-display");
      // $("#tab").slideToggle("fast");
      //				底部隐藏
      $("#footer").slideToggle("fast");
      $(this).toggleClass("btn-slide-bg");
      //				大框背景影藏
      $("#bigc").toggleClass("big-bg");
      // $("bigc").slideToggle("fast");
      $("bigc").toggleClass("big_bgc_save");
      // $("#nav-swiper").slideToggle("fast");

      //				头部导航隐藏
      $("#aui-header").toggleClass("header-bg");
      //				底部隐藏
      $("#aui-footer").toggleClass("nav-display");
      //				背景交替隐藏
      $('body').toggleClass('body-bg');
      //				搜索按钮交替显影
      $('#search-icon').toggleClass("search-icon-display");
      //				无内容栏影藏
      $(".more-ul").toggleClass("nav-display");
      //				内容frame隐藏
      $("#frame-container").toggleClass("nav-display");

      return false;
    });
  });


  btn1.onclick = function () {
    this.className = (this.className == "list-btn2" ? "list-btn1" : "list-btn2");
    this.innerHTML = (this.innerHTML == "完&nbsp;成" ? "编&nbsp;辑" : "完&nbsp;成");
    seleced = !seleced;
    if (seleced) {
      var el = document.getElementById("items");
      el.innerHTML = '';
      var selecedArr1 = ["_1", "_2", "_3"];
      for (let i of selecedArr) {
        selecedArr1.push(i)
      }
      console.log(selecedArr1)
      for (let i of selecedArr1) {
        var text;
        switch (i) {
          case "_1":
            text = "自选";
            break;
          case "_2":
            text = "市值";
            break;
          case "_3":
            text = "涨幅";
            break;
          case "_4":
            text = "BTC";
            break;
          case "_5":
            text = "ETH";
            break;
          default:
            text = getjysName(i);
            break;
        }
        switch (i) {
          case "_1":
          case "_2":
          case "_3":
            el.innerHTML += '<li class="aui-col-xs-3 aui-col-xs-4" data-id="' + i + '">\n' +
              '                           <div class="aui-btn">' + text + '</div>\n' +
              '                        </li>'
            break;
          default:
            console.log(text)
            el.innerHTML += '<li class="aui-col-xs-3 aui-col-xs-5" data-id="' + i + '">\n' +
              '                           <div class="aui-btn active-off">' + text + '</div>\n' +
              '                        </li>'
            break;
        }
      }
      $('#items li .active-off').toggleClass('aui-btn-active')
      moveBlocks();
    } else {
      init()
      $('#items li .active-off').removeClass('aui-btn-active')
      sortable.destroy();
    }
  }


  ajax_fordata()

  //初始化tab栏
  function init() {
    localStorage.setItem("selecedArr", selecedArr.join('|'));
    $("#tab").html("")
    var selecedArr1 = ["_1", "_2", "_3"]

    for (let i of selecedArr) {
      selecedArr1.push(i)
    }

    var navIndex = sessionStorage.getItem('navIndex')
    if (navIndex == "_1" || navIndex == "_2" || navIndex == "_3" || navIndex == "_4" || navIndex == "_5" || !navIndex) {
      window['openframe' + (navIndex || '_1')]();
    } else {
      openframeJYS(navIndex);
    }

    for (var i = 0; i < selecedArr1.length; i++) {
      var text;
      switch (selecedArr1[i]) {
        case "_1":
          text = "自选";
          break;
        case "_2":
          text = "市值";
          break;
        case "_3":
          text = "涨幅";
          break;
        case "_4":
          text = "BTC";
          break;
        case "_5":
          text = "ETH";
          break;
        default:
          text = getjysName(selecedArr1[i]);
          break;
      }

      switch (selecedArr1[i]) {
        case "_1":
        case "_2":
        case "_4":
        case "_5":
          $("#tab").append(`<li id="tabbar${selecedArr1[i]}" class="swiper-slide aui-tab-item" onclick="openframe${selecedArr1[i]}()">${text}</li>`);
          break;
        case "_3":
          $("#tab").append(`<li id="tabbar${selecedArr1[i]}" class="swiper-slide aui-tab-item" onclick="openframe${selecedArr1[i]}()">${text}<span class="zhang" id="zhang"></span><span class="die" id="die"></span></li>`);
          break;
        default:
          $("#tab").append(`<li id="tabbar${selecedArr1[i]}" class="swiper-slide aui-tab-item" onclick="openframeJYS(${selecedArr1[i]})">${text}</li>`);
          break;
      }
    }

    if (sessionStorage.getItem('navIndex') == "_3") {
      isbutton = true;
      if (type == 2) {
        $("#die").attr('class', 'die type-die');
        $("#zhang").attr('class', 'zhang');
      } else {
        $("#die").attr('class', 'die');
        $("#zhang").attr('class', 'zhang type-zhang');
      }
    }


    //	顶部菜单切换
    var swiper = new Swiper('.nav_swiper', {
      slidesPerView: 6.5,
      spaceBetween: 0,
      freeMode: true,
      pagination: {
        clickable: true,
      },
    });

    $(".swiper-slide").click(function () {
      if ($(this).attr('id') == "tabbar_3") {
        if (type == 2) {
          $("#die").attr('class', 'die type-die');
          $("#zhang").attr('class', 'zhang');
        } else {
          $("#die").attr('class', 'die');
          $("#zhang").attr('class', 'zhang type-zhang');
        }
        if (isbutton) {
          type == 2 ? type = 3 : type = 2;
          if (type == 2) {
            $("#die").attr('class', 'die type-die');
            $("#zhang").attr('class', 'zhang');
          } else {
            $("#die").attr('class', 'die');
            $("#zhang").attr('class', 'zhang type-zhang');
          }
        }
        isbutton = true;
      } else {
        isbutton = false
      }
    })

  }


  //拖拽排序 使用sortable插件
  function moveBlocks() {
    var el = document.getElementById("items");
    sortable = Sortable.create(el, {
      animation: 200,
      dataIdAttr: 'data-id',
      draggable: ".aui-col-xs-5",
      store: {
        get: function (sortable) {
          var order = localStorage.getItem("selecedArr");
          console.log(order)
          return order ? order.split('|') : [];
        },
        set: function (sortable) {
          selecedArr = sortable.toArray();
        }
      }
    });

    if (!a++) {
      sortable.destroy();
      init()
      btn1.onclick()
      btn1.onclick()
    }
  }

  function initzhangdie() {
    $("#die").attr('class', 'die');
    $("#zhang").attr('class', 'zhang');
  }

  function openframe_1() {
    console.log("aaa")

    sessionStorage.setItem('navIndex', "_1")
    initzhangdie()
    var likeList = JSON.parse(localStorage.getItem('likeLists'))

    if (!likeList) {
      likeList = []
    }

    if (likeList.length == 0) {
      var inserthtml = '<iframe id="zixuan" src="html/home/hangqing-zixuan0.html" name="zixuan-frame" width="100%" height="100%" srcoll="yes"></iframe>';
    } else {
      var inserthtml = '<iframe id="zixuan" src="html/home/hangqing-zixuan1.html" name="zixuan-frame" width="100%" height="100%" srcoll="yes"></iframe>';
    }

    $("#frame-container :first-child").remove();
    $("#frame-container").append(inserthtml);
    $("#tab").find("li").removeClass("aui-active");
    $("#tabbar_1").addClass("aui-active");
  }

  function openframe_2() {
    sessionStorage.setItem('navIndex', "_2")
    initzhangdie()
    var inserthtml = '<iframe id="zixuan" src="html/home/hangqing-shizhi.html" name="zixuan-frame" width="100%" height="100%" srcoll="yes"></iframe>';
    $("#frame-container :first-child").remove();
    $("#frame-container").append(inserthtml);
    $("#tab").find("li").removeClass("aui-active");
    $("#tabbar_2").addClass("aui-active");
  }

  function openframe_3() {
    sessionStorage.setItem('navIndex', "_3")
    var inserthtml = '<iframe id="zixuan" src="html/home/hangqing-zhangfu.html" name="zixuan-frame" width="100%" height="100%" srcoll="yes"></iframe>';
    $("#frame-container :first-child").remove();
    $("#frame-container").append(inserthtml);
    $("#tab").find("li").removeClass("aui-active");
    $("#tabbar_3").addClass("aui-active");

  }

  function openframe_4() {
    sessionStorage.setItem('navIndex', "_4")
    initzhangdie()
    var inserthtml = '<iframe id="zixuan" src="html/home/hangqing-btc.html" name="zixuan-frame" width="100%" height="100%" srcoll="yes"></iframe>';
    $("#frame-container :first-child").remove();
    $("#frame-container").append(inserthtml);
    $("#tab").find("li").removeClass("aui-active");
    $("#tabbar_4").addClass("aui-active");

  }

  function openframe_5() {
    sessionStorage.setItem('navIndex', "_5")
    initzhangdie()
    var inserthtml = '<iframe id="zixuan" src="html/home/hangqing-eth.html" name="zixuan-frame" width="100%" height="100%" srcoll="yes"></iframe>';
    $("#frame-container :first-child").remove();
    $("#frame-container").append(inserthtml);
    $("#tab").find("li").removeClass("aui-active");
    $("#tabbar_5").addClass("aui-active");

  }

  function openframeJYS(index) {
    sessionStorage.setItem('navIndex', index)
    sessionStorage.setItem('exchangeId', index)
    initzhangdie()
    var inserthtml = '<iframe id="zixuan" src="html/home/hangqing-jys.html" name="zixuan-frame" width="100%" height="100%" srcoll="yes"></iframe>';
    $("#frame-container :first-child").remove();
    $("#frame-container").append(inserthtml);
    $("#tab").find("li").removeClass("aui-active");
    $("#tabbar" + index).addClass("aui-active");

  }


  //tab切换
  function frameDisplay() {
    window.location.href = "../detail/detail.html";
  }

  function gotoSearch() {
    location.href = "../../html/search/search.html";
  }

  function gotoSearch1() {
    location.href = "html/search/search.html";
  }
</script>

</html>
